﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>@ViewBag.Title</title>
    @*@Styles.Render("~/Content/css")*@
    <link href="~/Content/bootstrap.css" rel="stylesheet" />
    <link href="~/Content/search-form.css" rel="stylesheet" />
    <link href="~/Content/homeLayout.css" rel="stylesheet" />
    @Scripts.Render("~/bundles/modernizr")
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/jquery-ui")
    @*@Scripts.Render("~/bundles/jquery-unobtrusive-ajax")*@
    <script src="~/Scripts/bootstrap.js"></script>
   <style>
       #dropmenu li, #dropmenu li a {
           display:inline-block;
           width: 150px;
           height: 40px;
           line-height: 40px;
       }
       
   </style>
</head>
<body>
    @*导航栏*@
    <nav id="navbar-example" class="navbar navbar-inverse navbar-static" style="margin-bottom:0;" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <button class="navbar-toggle" type="button" data-toggle="collapse"
                        data-target=".bs-js-navbar-scrollspy">
                    <span class="sr-only">切换导航</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                @*<a href="@Url.Content("~")"><img alt="logo" src="~/images/other/GSHOP.jpg" /></a>*@
                <a class="navbar-brand col-xs-offset-1" href="#" style="margin-left:0;padding-left:60px;">欢迎来到Thirteen Shop</a>
                
            </div>
            <div class="collapse navbar-collapse bs-js-navbar-scrollspy">
                <ul class="nav navbar-nav col-md-5">

                    @if (!User.Identity.IsAuthenticated)
                    {
                        <li>
                            @*<a href="#" data-toggle="modal" data-target="#myModal">
                            请您登录
                            </a>*@
                             @Html.ActionLink("请您登陆", "Login", "Member") 
                        </li>
                        <li>@Html.ActionLink("欢迎注册", "Register", "Member")</li>
                    }
                    else
                    {

                        <li> @Html.ActionLink("退出登录", "Logout", "Member")</li>
                    }
                </ul>
                <div class="col-md-1"></div>
                <ul class="nav navbar-nav col-md-4" id="leftBar">
                    <li><span class="glyphicon glyphicon-home"></span> @Html.ActionLink("首页", "Index", "Home")</li>
                    <li><span class="glyphicon glyphicon-shopping-cart"></span> @Html.ActionLink("购物车", "Index", "Cart")</li>
                    @*<li><span class="glyphicon glyphicon-user"></span> @Html.ActionLink("个人中心", "UserDetail", "Member")</li>*@
                    <li class="dropdown" id="accountmenu">
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <span class="glyphicon glyphicon-user"></span> 个人中心<b class="caret"></b></a>
                        <ul class="dropdown-menu" id="dropmenu">
                            <li><a href="~/Member/Useroder">订单中心</a></li>
                            <li><a href="~/Member/Editpasswd">修改密码</a></li>
                            <li><a href="~/Member/UserDetail">查看个人信息</a></li>
                            @*<li class="divider"></li>*@
                            <li><a href="~/Member/Editaddress">修改收货地址</a></li>
                            
                        </ul>
                    </li>

                    <li>
                        <span class="glyphicon glyphicon-asterisk"></span> @Html.ActionLink("后台管理", "Login", "AdminRegister")
                        @*<ul class="dropdown-menu" role="menu"
                                aria-labelledby="navbarDrop1">
                                <li><a href="#jmeter" tabindex="-1">jmeter</a></li>
                                <li><a href="#ejb" tabindex="-1">ejb</a></li>
                                <li class="divider"></li>
                                <li><a href="#spring" tabindex="-1">spring</a></li>
                            </ul>*@
                    </li>
                </ul>
            </div>

        </div>
    </nav>
    
    <div id="header" class="container col-md-10 col-md-offset-1  row">
        <div id="top" class="col-md-3  col-xs-12">
            <a ><img alt="logo" height="100" width="200" src="~/images/logo3.png" /></a>
        </div>

        <span class="col-md-3 col-xs-12 span5" style="margin-left:-33px;   margin-top:40px;margin-right:-70px" id="headerLife">精品生活，上Thirteen Shop!</span>
        <div class="container col-md-4 col-xs-12" style="margin-top:10px">
        <section >
            <form action="~/Home/ProductSearch" method="post">
                <div class="search-wrapper active">
                    <div class="input-holder" style="height:50px;">
                        <input type="text" class="search-input" name="searchcontent" style="height:35px;" placeholder="开始搜索" />
                        <button class="search-icon" style="height:35px;" onclick="searchToggle(this, event);"><span></span></button>
                    </div>
                    <span class="glyphicon glyphicon-remove close" style="top:10px;background-color:#202340" onclick="searchToggle(this, event);"></span>
                    <div class="result-container">

                    </div>
                </div>
            </form>
        </section>
            </div>

        
    </div>
    <legend class="container col-md-10 col-md-offset-1" style="margin-top:-20px"></legend>

    @*<div id="header">
            <div id="nav">
                <ul>
                <li>@Html.ActionLink("首页","Index","Home")</li>
                <li>@Html.ActionLink("购物车","Index","Cart")</li>
                <li>@Html.ActionLink("后台管理","Login","AdminRegister")</li>
                @if(!User.Identity.IsAuthenticated)
                {
                   <li>@Html.ActionLink("登陆","Login","Member")</li>
                   <li>@Html.ActionLink("注册","Register","Member")</li>
                }
                else
                {
                   <li>@Html.ActionLink("注销","Logout","Member")</li>
                }

                </ul>
            </div>
            <div id="top">
                <a href="@Url.Content("~")"><img alt="logo"  src="~/images/other/GSHOP.jpg" /></a>
            </div>
        </div>*@
    <div id="content" class="col-md-10 col-md-offset-1" >
        @RenderBody()
    </div>

    <div id="footer" class="col-md-12 text-center" style="background-color:#222222;height:100px;padding-top:25px;color:white;margin-top:20px;">
        <div>
            <p>&copy;@DateTime.Now.Year 版权归计算机与信息工程学院第十三组全体成员所有</p>
            <p>小组成员：于媛媛 刘逸冰  车巷荧 赵国霞</p>
        </div>
    </div>


    <!-- 模态框（Modal） -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="myModalLabel">会员登录</h4>
                </div>
                <div class="modal-body">

                    <form class="form-horizontal" role="form">
                        <div class="form-group">
                            <label for="wsc-username" class="col-sm-2 control-label">用户名：</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="wsc-username" placeholder="请输入用户名">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="wsc-password" class="col-sm-2 control-label">密码：</label>
                            <div class="col-sm-10">
                                <input type="password" class="form-control" id="wsc-password" placeholder="请输入密码">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <div class="checkbox">
                                    <label>
                                        <input type="checkbox" id="rmbUser">请记住我(七天之内有效)
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-6 text-center">
                                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                            </div>
                            <div class="col-sm-6 text-center">
                                <button type="submit" onclick="saveUserInfo()" class="btn btn-primary">登录</button>
                            </div>
                        </div>
                    </form>
                </div>


            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>

    
    @RenderSection("scripts", required: false)
    @RenderSection("Styles", required: false)
    <script src="~/Scripts/jquery.cookie.js"></script>
    <script>
        //记住密码
        @*$(document).ready(function () {
            if ($.cookie("rmbUser") == "true") {
                $("#rmbUser").attr("checked", true);
                $("#wsc-username").val($.cookie("userName"));
                $("#wsc-password").val($.cookie("passWord"));
            }
        });


        function saveUserInfo() {
            if ($("#rmbUser").attr("checked") == true) {
                var userName = $("#wsc-username").val();
                var passWord = $("#wsc-password").val();
                $.cookie("rmbUser", "true", { expires: 7 }); // 存储一个带7天期限的 cookie
                $.cookie("userName", userName, { expires: 7 }); // 存储一个带7天期限的 cookie
                $.cookie("passWord", passWord, { expires: 7 }); // 存储一个带7天期限的 cookie
            }
            else {
                $.cookie("rmbUser", "false", { expires: -1 });        // 删除 cookie
                $.cookie("userName", '', { expires: -1 });
                $.cookie("passWord", '', { expires: -1 });
            }
        }*@


        function searchToggle(obj, evt) {
            var container = $(obj).closest('.search-wrapper');

            if (!container.hasClass('active')) {
                container.addClass('active');
                evt.preventDefault();
            }
            else if (container.hasClass('active') && $(obj).closest('.input-holder').length == 0) {
                container.removeClass('active');
                // clear input
                container.find('.search-input').val('');
                // clear and hide result container when we press close
                container.find('.result-container').fadeOut(100, function () { $(this).empty(); });
            }
        }

        function submitFn(obj, evt) {
            //value = $(obj).find('.search-input').val().trim();

            //_html = "Yup yup! Your search text sounds like this: ";
            //if (!value.length) {
            //    _html = "Yup yup! Add some text friend :D";
            //}
            //else {
            //    _html += "<b>" + value + "</b>";
            //}

            //$(obj).find('.result-container').html('<span>' + _html + '</span>');
            //$(obj).find('.result-container').fadeIn(100);

            //evt.preventDefault();
        }
    </script>
</body>

</html>
